import { Module } from '@nestjs/common';
import { StaticService } from './static.service';
import { StaticController } from './static.controller';
import { Repository } from 'typeorm';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Order } from '../entity/order.entity';
import { OrderItem } from '../entity/order-item.entity';
import { ProductSku } from '../entity/product-sku.entity';
import { Shipping } from '../entity/shipping.entity';
import { Payment } from '../entity/payment.entity';
import { PaymentRecord } from '../entity/payment-record.entity';
import { OrderNumberService } from '../order-number/order-number.service';
import { FormatService } from '../format/format.service';
import { User } from '../entity/user.entity';
import { Product } from '../entity/product.entity';
import { UserDetail } from 'src/entity/userDetail.entity';
import { PaymentModule } from 'src/payment/payment.module';
import { CacheModule } from '@nestjs/cache-manager';
@Module({
  imports: [Repository,
    CacheModule.register({
      isGlobal: true,
      provider: 'redis',
      port: 6379,
      ttl: 3600000, // 默认缓存1小时
      max: 100, // 最多缓存100条数据
    }),
    TypeOrmModule.forFeature([
        User,
        Order,
        OrderItem,
        Payment,
        Product,
        ProductSku,
        UserDetail,
        PaymentModule,
        PaymentRecord,
        Order,
        Shipping
    ]),
  ],


  providers: [StaticService,OrderNumberService],
  controllers: [StaticController]
})
export class StaticModule {}
